package com.crealth.model;

import java.io.Serializable;
import java.sql.Timestamp;

import com.alibaba.fastjson.JSONObject;

public class ConsumerProductModel implements Serializable {
	private static final long serialVersionUID = 7195024L;
	
	public static final int Status_ZBZL = 1;  // 准备资料
	public static final int Status_Commit = 2;  // 已提交
	public static final int Status_DSY = 3;  // 待收佣
	public static final int Status_YSY = 4;  // 已收佣
	public static final int Status_DZY = 5;  // 定转佣
	public static final int Status_Cancel = 6;  // 取消
	public static final int Status_Reject = 7;  // 拒绝
	public static final int Status_Overdue = 8;  // 过期回佣
	
	public static final int DJ_WS = 0;  //  定金 未收
	public static final int DJ_YS = 1;  //  定金 已收
	public static final int DJ_YT = 2;  //  定金 已退
	public static final int DJ_YD = 3;  //  定金 已抵
	public static final int DJ_DZY = 4;  //  定金 转佣金
	public static final int DJ_START_BACK = 11;  //  客服  发起退定金
	public static final int DJ_DaiHe = 12;  //  分公司经理  核实
	public static final int DJ_DaiTui = 13;  // 财务退款
	public static final int DJ_TK_ALREADY = 14;  //  已退款
	public static final int DJ_BACK_CANCEL = 15;  // 撤销
	
	private int id;
	private String productNo;
	private int contractID;
	private int userID;
	private String productName;
	private int companyID;
	private String earnestPaytype;  // 定金支付方式
	private int earnestStatus;  //  定金状态
	private int followStatus;  //  跟进状态
	private String mortgagerName;  // 按揭经理
	private Timestamp bankSignTm;  // 银行签约日期
	private String bankExtendLoan;  // 放款金额
	private Timestamp extendLoanTm;  // 放款日期
	private Timestamp brokerageTm;  //收佣日期
	private String brokerage;  // 实收佣金
	private int basePushMoney;  // 基本提成
	private int extraPushMoney;  // 额外提成
	private int mortgagerPushMoney;  // 按揭提成
	private String customerServiceMemo;  //  客服备注
	private int status;  //  跟进状态
	private int accept;  // 按揭经理是否 接受
	private String realEarnest;  //  实收定金
	private String financeMemo;  //  财务 备注
	private Timestamp createProductTm;  // 
	
	public ConsumerProductModel() {
		productName = "";
		bankExtendLoan = "";
		mortgagerName = "";
		customerServiceMemo = "";
		bankSignTm = null;
		extendLoanTm = null;
		brokerageTm = null;
		earnestPaytype = "";
		realEarnest = "";
		financeMemo = "";
		createProductTm = null;
	}
	
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getProductNo() {
		return productNo;
	}
	public void setProductNo(String productNo) {
		this.productNo = productNo;
	}
	public int getContractID() {
		return contractID;
	}	
	public int getUserID() {
		return userID;
	}
	public void setUserID(int userID) {
		this.userID = userID;
	}
	public void setContractID(int contractID) {
		this.contractID = contractID;
	}
	public String getProductName() {
		return productName;
	}
	public void setProductName(String productName) {
		this.productName = productName;
	}
	public String getEarnestPaytype() {
		return earnestPaytype;
	}
	public void setEarnestPaytype(String earnestPaytype) {
		this.earnestPaytype = earnestPaytype;
	}
	public int getEarnestStatus() {
		return earnestStatus;
	}
	public void setEarnestStatus(int earnestStatus) {
		this.earnestStatus = earnestStatus;
	}
	public int getFollowStatus() {
		return followStatus;
	}
	public void setFollowStatus(int followStatus) {
		this.followStatus = followStatus;
	}
	public String getMortgagerName() {
		return mortgagerName;
	}
	public void setMortgagerName(String mortgagerName) {
		this.mortgagerName = mortgagerName;
	}
	public Timestamp getBankSignTm() {
		return bankSignTm;
	}
	public void setBankSignTm(Timestamp bankSignTm) {
		this.bankSignTm = bankSignTm;
	}
	public String getBankExtendLoan() {
		return bankExtendLoan;
	}
	public void setBankExtendLoan(String bankExtendLoan) {
		this.bankExtendLoan = bankExtendLoan;
	}
	public Timestamp getExtendLoanTm() {
		return extendLoanTm;
	}
	public void setExtendLoanTm(Timestamp extendLoanTm) {
		this.extendLoanTm = extendLoanTm;
	}
	public Timestamp getBrokerageTm() {
		return brokerageTm;
	}
	public void setBrokerageTm(Timestamp brokerageTm) {
		this.brokerageTm = brokerageTm;
	}
	public String getBrokerage() {
		return brokerage;
	}
	public void setBrokerage(String brokerage) {
		this.brokerage = brokerage;
	}
	public int getBasePushMoney() {
		return basePushMoney;
	}
	public void setBasePushMoney(int basePushMoney) {
		this.basePushMoney = basePushMoney;
	}
	public int getExtraPushMoney() {
		return extraPushMoney;
	}
	public void setExtraPushMoney(int extraPushMoney) {
		this.extraPushMoney = extraPushMoney;
	}
	public int getMortgagerPushMoney() {
		return mortgagerPushMoney;
	}
	public void setMortgagerPushMoney(int mortgagerPushMoney) {
		this.mortgagerPushMoney = mortgagerPushMoney;
	}
	public String getCustomerServiceMemo() {
		return customerServiceMemo;
	}
	public void setCustomerServiceMemo(String customerServiceMemo) {
		this.customerServiceMemo = customerServiceMemo;
	}
	public int getCompanyID() {
		return companyID;
	}
	public void setCompanyID(int companyID) {
		this.companyID = companyID;
	}
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	public int getAccept() {
		return accept;
	}
	public void setAccept(int accept) {
		this.accept = accept;
	}	
	public String getRealEarnest() {
		return realEarnest;
	}

	public void setRealEarnest(String realEarnest) {
		this.realEarnest = realEarnest;
	}
	public String getFinanceMemo() {
		return financeMemo;
	}
	public void setFinanceMemo(String financeMemo) {
		this.financeMemo = financeMemo;
	}	
	public Timestamp getCreateProductTm() {
		return createProductTm;
	}
	public void setCreateProductTm(Timestamp createProductTm) {
		this.createProductTm = createProductTm;
	}

	public JSONObject toJSONObject() {
		JSONObject jsonObj = new JSONObject();
		if (id > 0) {
			jsonObj.put("id", id);
		}
		if (productNo != null && productNo.length() > 0) {
			jsonObj.put("productNo", productNo);
		}
		jsonObj.put("userID", userID);
		if (contractID > 0) {
			jsonObj.put("contractID", contractID);
		}
		if (productName != null && productName.length() > 0) {
			jsonObj.put("productName", productName);
		}
		if (companyID > 0) {
			jsonObj.put("companyID", companyID);
		}
		if (earnestPaytype != null && earnestPaytype.length() > 0) {
			jsonObj.put("earnestPaytype", earnestPaytype);
		}
		if (earnestStatus >= 0) {
			jsonObj.put("earnestStatus", earnestStatus);
		}
		if (followStatus >= 0) {
			jsonObj.put("followStatus", followStatus);
		}
		if (mortgagerName != null && mortgagerName.length() > 0) {
			jsonObj.put("mortgagerName", mortgagerName);
		}
		if (bankSignTm != null) {
			jsonObj.put("bankSignTm", bankSignTm.getTime() / 1000);
		}
		if (bankExtendLoan != null && bankExtendLoan.length() > 0) {
			jsonObj.put("bankExtendLoan", bankExtendLoan);
		}
		if (extendLoanTm != null) {
			jsonObj.put("extendLoanTm", extendLoanTm.getTime() / 1000);
		}
		if (brokerageTm != null) {
			jsonObj.put("brokerageTm", brokerageTm.getTime() / 1000);
		}
		if (brokerage != null && brokerage.length() > 0) {
			jsonObj.put("brokerage", brokerage);
		}
		if (basePushMoney >= 0) {
			jsonObj.put("basePushMoney", basePushMoney);
		}
		if (extraPushMoney >= 0) {
			jsonObj.put("extraPushMoney", extraPushMoney);
		}
		if (mortgagerPushMoney >= 0) {
			jsonObj.put("mortgagerPushMoney", mortgagerPushMoney);
		}
		if (customerServiceMemo != null && customerServiceMemo.length() > 0) {
			jsonObj.put("csMemo", customerServiceMemo);
		}
		if (status >= 0) {
			jsonObj.put("status", status);
		}
		if (accept >= 0) {
			jsonObj.put("accept", accept);
		}
		if (realEarnest != null && realEarnest.length() > 0) {
			jsonObj.put("realEarnest", realEarnest);
		}
		if (financeMemo != null && financeMemo.length() > 0) {
			jsonObj.put("financeMemo", financeMemo);
		}
	
		return jsonObj;
	}

}
